package io.renren.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.commons.mybatis.service.impl.CrudServiceImpl;
import io.renren.dao.MessageDao;
import io.renren.dto.MessageDTO;
import io.renren.entity.MessageEntity;
import io.renren.service.MessageService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 消息通知
 *
 * @author liuyujun 384880231@qq.com
 * @since 3.0 2022-01-13
 */
@Service
public class MessageServiceImpl extends CrudServiceImpl<MessageDao, MessageEntity, MessageDTO> implements MessageService {

    @Override
    public QueryWrapper<MessageEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<MessageEntity> wrapper = new QueryWrapper<>();

        String category = (String)params.get("category");
        wrapper.eq(StringUtils.isNotBlank(category), "category", category);

        return wrapper;
    }


}